FROM ubuntu:14.04

MAINTAINER joen kai168@126.com

ENV HADOOP_VERSION 2.7.5

RUN set -ex; \
      sed -i 's/http:\/\/archive\.ubuntu\.com/http:\/\/mirrors\.aliyun\.com/' /etc/apt/sources.list;

RUN set -ex; \
      apt-get update; \
      apt-get install -y curl openjdk-7-jdk libprotobuf-dev protobuf-compiler maven cmake build-essential pkg-config libssl-dev zlib1g-dev llvm-gcc automake autoconf make; 
RUN cd ~; \
      curl -fSL -o hadoop-$HADOOP_VERSION.tar.gz https://github.com/apache/hadoop/archive/rel/release-$HADOOP_VERSION.tar.gz; \
      tar xzf hadoop-$HADOOP_VERSION.tar.gz; \
      cd hadoop-rel-release-$HADOOP_VERSION
      #curl -fSL -O https://mirrors.aliyun.com/apache/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION-src.tar.gz 
      # tar xzf hadoop-$HADOOP_VERSION-src.tar.gz;
      #https://mirrors.aliyun.com/apache/hadoop/core/hadoop-2.7.5/